$(document).ready(function(){
    $('#cookbookCarousel').carousel({interval:5000});//每隔5秒自动轮播
    $('#cookbookCarousel').carousel({interval:8000});//每隔5秒自动轮播
});
$(function () {

    /*轮播图切换时改变标签*/
    var index = 0;
    $('#monthCookbookCarousel').on('slide.bs.carousel', function (event) {
        var hoder = $('#monthCookbookCarousel').find('.item'),
            items = $(event.relatedTarget);
        //getIndex就是轮播到当前位置的索引
        $('#tab' + index).removeClass('tab-color-active');
        var getIndex= hoder.index(items);
        index = getIndex;
        $('#tab' + index).addClass('tab-color-active');
    })
});